package com.zsrt.java.day20170111.lh.daily.ch03;

import static org.junit.Assert.*;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.junit.Test;

public class SimpleDateFormatTest {
	
	@Test
	public void testName() throws Exception {
		
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		Date date =new Date();
		
		//把时间装换成字符串
		String format = sdf.format(date);
		System.out.println(format);
		
		//把字符串转化成时间
		Date dd = sdf.parse(format);
		
		Date now=new Date();
		System.out.println(now.after(dd));
		System.out.println(dd);
		
	}
	

}
